package client

import (
	"github.com/labstack/echo/v4"
	"rabbit_love/src/conf"
	"rabbit_love/src/service/client/routes"
	"rabbit_love/src/service/client/utils"
	"rabbit_love/src/service/client/utils/cache"
	"rabbit_love/src/service/client/views/chat_views"
	"rabbit_love/src/utils/oss"
)

func init() {
	utils.CreateClientDB()
	cache.InitRedis()

	chat_views.StartClientManager()

	oss.InitFileBucket(conf.OSSBucket, conf.OSSEndpoint, conf.OSSAccesskeyID, conf.OSSAccessKeySecret)
}

func ClientInit(app *echo.Echo) {
	app.GET("", func(context echo.Context) error {
		return context.HTML(200, "<h1>Hello World</h1>")
	})
	routes.MountRoute(app.Group("/v1"))
}
